-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USD -> SDF: polygon triangulation #819
USD -> SDF: polygon triangulation #819
Conversation
Signed-off-by: Teo Koon Peng <[email protected]>
|
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
… koonpeng/polygon-triangulation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something is wrong here.
- I modified the
gearjoint.usd
insideIssacSim
and I removed everything expect one of the cylinders and I saved this world - Then I converted this saved world with the
sdfconverter
and I get the following shape:
If we forget for a moment the transformations, the mesh is not rendered properly.
Signed-off-by: Teo Koon Peng <[email protected]>
🎉 New feature
Summary
This implements the
PolygonToTriangles
function using the fan-triangulation algorithm. Initially tried to implement delaunay triangulation based on ignition::common's implementation, but the implementation is a wrapper around gts's implementation, which does not support 3D.While researching a custom implementation, found out that there is a much simpler way using the fan-triangulation, it is not as robust as delaunay but it looks like a better fit for the use case of triangulating convex polygons. It seems like tools like blender also uses a form of fan-triangulation of these use cases and delaunay is more commonly used for more complex scenarios like generating terrains/heightmaps etc.
Test it
Currently tested with
GearJoint.usd
in isaac sim's examples (should be able to find it with a file system search). It seems to work somewhat, but I'm not sure if the current output is due to bad triangulation or other bugs.usd:
sdf:
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.